using System;
using UnityEngine;

[ExecuteInEditMode]
public class MapEditorItem : MonoBehaviour
{
    [SerializeField] private Vector2 pos;
    [SerializeField] private E_MapItemType currentMapType;
    
    [HideInInspector] public SpriteRenderer spriteRenderer;

    public E_MapItemType MapType => currentMapType;

    public void SetSprite(Sprite sprite)
    {
        spriteRenderer.sprite = sprite;
    }

    public void SetType(E_MapItemType type)
    {
        currentMapType = type;
    }
    
    public void SetType(int typeIndex)
    {
        SetType((E_MapItemType)typeIndex);
    }
    
    public enum E_MapItemType
    {
        None = 0,
        Brick = 1,
        Iron = 2,
        Grass = 3,
        Snow = 4,
        Sand = 5,
        Water = 6
    }
}
